package com.example.loader;

import com.hazelcast.config.Config;
import com.hazelcast.config.JoinConfig;
import com.hazelcast.config.MulticastConfig;
import org.springframework.stereotype.Service;

/*
 * @className: HazelcastMulticastStoreLoader
 * @author: chentao
 * @date: 2025/2/19 上午8:08
 * @Version: 1.0
 * @description:
 */
@Service
public class HazelcastMulticastStoreLoader implements HazelcastLoader {

    //加载网络配置
    @Override
    public void loadConfig(Config config) throws Exception {
        JoinConfig joinConfig = new JoinConfig();
        MulticastConfig multicastConfig = new MulticastConfig();
        multicastConfig.setEnabled(true);
        joinConfig.setMulticastConfig(multicastConfig);
        config.getNetworkConfig().setJoin(joinConfig);
    }
}
